UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lUG55Qd/Dc/Itp2geeMCrCs5XJsRywIE+dRQlBJmTqo=' 
WHERE 
  key_id = '4ede9f829ff77de9c15a47a27f46e8a2432bb9568eea025f9cd8462853c8850c' 
  AND (
    token = 'lUG55Qd/Dc/Itp2geeMCrCs5XJsRywIE+dRQlBJmTqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031