UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BNR3oFgO2QeUKYl1WbN2H5ZH+DGTzxl+PmN94FFwg4A=' 
WHERE 
  key_id = '29f05408a8f2e74963c0130b6131e49605fd68e27206caccac85a82be281fec6' 
  AND (
    token = 'BNR3oFgO2QeUKYl1WbN2H5ZH+DGTzxl+PmN94FFwg4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074