UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BWzEKO7cATiFmJ6IfVrOSqRvf8r/p+vdwBmMOygLtYE='
WHERE
key_id = 'fb1d019669d09f9b6f0528de4c345d59a8151b4d22fc7ebbe167683d3bb8033b'
AND (
token = 'BWzEKO7cATiFmJ6IfVrOSqRvf8r/p+vdwBmMOygLtYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)