UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FueKRvUqkoqpOGwUwcQ1o6A1jWyw8Z8f8DxfOOtTthc=' 
WHERE 
  key_id = 'd07ab69770200dd76ade6eaed3370126a84d71ddbcf151c56f0e02684c94a106' 
  AND (
    token = 'FueKRvUqkoqpOGwUwcQ1o6A1jWyw8Z8f8DxfOOtTthc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075