UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CW/m7wdQgSaqnIgNYMiX+aK7wAdNbyiSPN4OoZ38ttw=' 
WHERE 
  key_id = '33adf842706001a7cdd67177cc89e186e85b34ea1e65e004edadcf65c59306ad' 
  AND (
    token = 'CW/m7wdQgSaqnIgNYMiX+aK7wAdNbyiSPN4OoZ38ttw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023