UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DfQAjMFcLzyrNoKyR844xbH6UY7e8T2wmSaIFU+npQA=' 
WHERE 
  key_id = '5dec1883cc067a45ed9ef9cd124addc2f58f7572f807f61f32e08a6ef2347556' 
  AND (
    token = 'DfQAjMFcLzyrNoKyR844xbH6UY7e8T2wmSaIFU+npQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015