UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5aV2agQNh/zi0ZgVR8znXMGq3bzUlzbpXtf+YpjmAdo=' 
WHERE 
  key_id = '23b61ccbadc5988e6e396f59854f6813f5d7a5ffcae84fb4519322f6861de7ce' 
  AND (
    token = '5aV2agQNh/zi0ZgVR8znXMGq3bzUlzbpXtf+YpjmAdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024