UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MXmfvqjjXWXpreWGFqpDlPX6FKAaSVtrD5lfQrsEvEY=' 
WHERE 
  key_id = '9c874715be7bf29c387dd97ce4d3eb84e4ca6051d0566229f514c7466ea2a883' 
  AND (
    token = 'MXmfvqjjXWXpreWGFqpDlPX6FKAaSVtrD5lfQrsEvEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047