UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'smyh1IMY8YHCLY+t23nbvC9gQjpyIDd4gkvzvQPOk/Q=' 
WHERE 
  key_id = '8d3e6f678961bacb931167447f944a47271ff22725e78d7f19e6ae831a2b0025' 
  AND (
    token = 'smyh1IMY8YHCLY+t23nbvC9gQjpyIDd4gkvzvQPOk/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014