UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tJ7Ehd+MJGzGsZLVkJM/5iJPsi3MHwA7tl6GlW6IOqc=' 
WHERE 
  key_id = '232530c93ca36ae1b024ecb4403546e6ebe5d358a224403587d3cf82c5dadb03' 
  AND (
    token = 'tJ7Ehd+MJGzGsZLVkJM/5iJPsi3MHwA7tl6GlW6IOqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00413