UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Eyvm98WjlfUsuKBSNHYHUdCXPrByU74il3f64bsDJQA='
WHERE
key_id = 'a47e32174bbc274b74d460d933dc7d7925aaa053f989d8af1a067115ac9ca5b2'
AND (
token = 'Eyvm98WjlfUsuKBSNHYHUdCXPrByU74il3f64bsDJQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)