UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BH+Ni9mfBhDRxYs3xpeI9bWxuNX5KzqH5PAphqDExXk=' 
WHERE 
  key_id = 'b141c48379b278ff8c2cd6ba817d9eadf42c415a74ceb04db241bb991b8eadea' 
  AND (
    token = 'BH+Ni9mfBhDRxYs3xpeI9bWxuNX5KzqH5PAphqDExXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027