UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/dbmTqpYnuoZPd2zZ5xgBD64ZvgQVwNkqo5VQbf8KQY=' 
WHERE 
  key_id = 'e7675c6709990c8abb5f8d6b5d4459a8d1e67358303f1a65068ec0f99c4b1c9f' 
  AND (
    token = '/dbmTqpYnuoZPd2zZ5xgBD64ZvgQVwNkqo5VQbf8KQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038