UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Gd0wSDhS3Ded9UsIMuyocsUfca8h0vlxoSH8uMVhHA='
WHERE
key_id = '3749f2c69644fb4b6b910c1dc955878a534b81a266bd6bafb0543aae18516fd8'
AND (
token = '6Gd0wSDhS3Ded9UsIMuyocsUfca8h0vlxoSH8uMVhHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)