UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ydAHaBK5NBQnxQOfDiCRqU9ByWZc7OPA4bUN+o7zpvk=' 
WHERE 
  key_id = '83dc6cd392e9d793e373713fd1c9211ba729c5fb6334386dc0ef9cadb052013d' 
  AND (
    token = 'ydAHaBK5NBQnxQOfDiCRqU9ByWZc7OPA4bUN+o7zpvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033