UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QoLT5N5ifwln1UuwTnF+k0/DUs6Qhsos6aEGEoDiLxA=' 
WHERE 
  key_id = '013318409e46a72d3aad5ab121647fceca72444ee8d2de45c459a7ddf1dc5e9b' 
  AND (
    token = 'QoLT5N5ifwln1UuwTnF+k0/DUs6Qhsos6aEGEoDiLxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036