UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1SVbMMSS9Y7cJQgzG5wxdiH98XNnC8bVFk++6kMsE9I=' 
WHERE 
  key_id = '7827030f810a8302a6a8725c95f22f8a9979ad46e413119db8d9bbe8c8789dd5' 
  AND (
    token = '1SVbMMSS9Y7cJQgzG5wxdiH98XNnC8bVFk++6kMsE9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033