UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gCNovrIp1WP8UaHS10e76Bhzybuqjw2Nv4/lyl9rgbg='
WHERE
key_id = '5454afc148ab753cec7cdad5e8cd030e4ad0013e2c419c317572e5b419d94afd'
AND (
token = 'gCNovrIp1WP8UaHS10e76Bhzybuqjw2Nv4/lyl9rgbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)