UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o0AVdDX/wt5R117cnV1rgQTjpuNG+PAns9CxxQC05kE='
WHERE
key_id = '23ccd457fbeab832294eb1e062f22fd2553bd55c9cd7ee457da797dd71ffe82f'
AND (
token = 'o0AVdDX/wt5R117cnV1rgQTjpuNG+PAns9CxxQC05kE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)