UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqma9cSnETh1NvI5zQv6MyTun1SJ/7K9ICP1Fcfha54=' 
WHERE 
  key_id = 'd7321a8e7307e1c2fe99762d83a07a0c1e66debe50ab2e4d2ca4ab1f71298875' 
  AND (
    token = 'xqma9cSnETh1NvI5zQv6MyTun1SJ/7K9ICP1Fcfha54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040