UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PF6A2L+d91Ocj03HEbluXRRDEpgItp/7g30KL7JXgBs=' 
WHERE 
  key_id = 'f80fe667e24db945b24ad581ca66b65ad63186a8c3589c42c3b791248dd9b94c' 
  AND (
    token = 'PF6A2L+d91Ocj03HEbluXRRDEpgItp/7g30KL7JXgBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040