UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6jfl/7I6gX1z92eJmEQVWTXUOB3LPkTVp0rQ30obFsA='
WHERE
key_id = '8c5edb8aab4a5c5f1c169c270a7872786d21a3d05625c5e090233aab5fe898ad'
AND (
token = '6jfl/7I6gX1z92eJmEQVWTXUOB3LPkTVp0rQ30obFsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)