UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/vxDevH0qOUaCWgKyaBZ4X2v4cg9e+XwCitj50MyHvE='
WHERE
key_id = 'e2d8b27e4e678c6c04606686c636ecc774d7897b60f0850cf7bcb52743746019'
AND (
token = '/vxDevH0qOUaCWgKyaBZ4X2v4cg9e+XwCitj50MyHvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)