UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c9D59wIN3DjkapX9azd+AWKvz1Hu+p9QoqZJd7a9T+A='
WHERE
key_id = '1c7b185344c17111bdea3562adf566202f268d9659fca9c7208b33bbc777dbc0'
AND (
token = 'c9D59wIN3DjkapX9azd+AWKvz1Hu+p9QoqZJd7a9T+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)