UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uBOWwDAW/qezaoKd1fhoRvppYjzej8833amgruI7hlc=' 
WHERE 
  key_id = 'e549cca0dfa85a6281260d815b7db2d4b3bb457d2df1cb671b1d7f24cb557378' 
  AND (
    token = 'uBOWwDAW/qezaoKd1fhoRvppYjzej8833amgruI7hlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021