UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VqTN3wMbP7G2p6WmlbDyH7M02WsqUEA1Uwot5CUHeQQ=' 
WHERE 
  key_id = '0423689b6d0065c96ae4f1125de7b61161bb2956471e701ff2d1c2968667b3a3' 
  AND (
    token = 'VqTN3wMbP7G2p6WmlbDyH7M02WsqUEA1Uwot5CUHeQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034