UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BZ9hSo8UemRHDfWb8B8hIzg4fshFaR9LiR4PMzHpsZQ=' 
WHERE 
  key_id = '6d8d8e8b7bbb754e37089f4459980b526a69840cb52bb598cc9f318d0dd86cf4' 
  AND (
    token = 'BZ9hSo8UemRHDfWb8B8hIzg4fshFaR9LiR4PMzHpsZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017