UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ur6w1Iag3685VsMk/Rahv9E5bqjbZGA4NY1r4MU6CUo=' 
WHERE 
  key_id = 'ef8610004d82dd740570c403508b9f1bea3743d5f99a9e7597b9252226c4de44' 
  AND (
    token = 'Ur6w1Iag3685VsMk/Rahv9E5bqjbZGA4NY1r4MU6CUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024