UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vO0VOnIs1BpChBGtgR6faNhozl9Qe/7e93j/Scyn5Ts=' 
WHERE 
  key_id = '99ffb06ed03e9f75dfc9f6e889988fbe2049a0c592af5b596ccc2e0bc9e55fa6' 
  AND (
    token = 'vO0VOnIs1BpChBGtgR6faNhozl9Qe/7e93j/Scyn5Ts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023