UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOeF3j4zxmLYr5ytX0ARXw7x8WmLgCAcAiDabyqeZ6c='
WHERE
key_id = '042285b217c90dc313c6d3d1ba6c8551b2ad31862c0917e93d1ce756432cb342'
AND (
token = 'sOeF3j4zxmLYr5ytX0ARXw7x8WmLgCAcAiDabyqeZ6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)