UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NCVJr4c4p9d9rdbWiq4DXUun/t6joCq4BSRB6Gy66CU='
WHERE
key_id = '5d47421118bdaa8b20cfe2480be59c76623cdec0aed1dc63294d616f4891a0fa'
AND (
token = 'NCVJr4c4p9d9rdbWiq4DXUun/t6joCq4BSRB6Gy66CU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)