UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LUPEGC+Z8RV963CarXWladpFDmV1I39TH01jODJbEjY=' 
WHERE 
  key_id = '7a66a29fd33311106ce723fd0a36e8149e0ceb45825a8f4142f4571008f850fa' 
  AND (
    token = 'LUPEGC+Z8RV963CarXWladpFDmV1I39TH01jODJbEjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046