UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qfi+8qt6/KYE//WbcYHFChtsXHDvmk6/qpLqRMSUWEE='
WHERE
key_id = 'aa2d08c57c1d02d4ccc5ab3d8877e3f6b5cfb3b1d8834b752124580f2dde362a'
AND (
token = 'qfi+8qt6/KYE//WbcYHFChtsXHDvmk6/qpLqRMSUWEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)