UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UGvLUOC9uGEt6DAYTiqDpTnB2+mVy7XhbXcpQZhSYM0=' 
WHERE 
  key_id = 'e39581a1b0d837421db5006f72bd0d3d262f13fa76ffcd3f102f5d022bf7a20c' 
  AND (
    token = 'UGvLUOC9uGEt6DAYTiqDpTnB2+mVy7XhbXcpQZhSYM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050