UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/9aY3gkNppVqscuyD5FcZcA5NMN/1Nrr5pYILfX3Zg=' 
WHERE 
  key_id = '9d9a193f5aab973186a5925d4fca4eef7a6e7b06dd94470627cfbf00fe04f4c1' 
  AND (
    token = '1/9aY3gkNppVqscuyD5FcZcA5NMN/1Nrr5pYILfX3Zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049