UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bqdLNSo1w79mNDv5DYIpV2Bx3TIoc8IfHn3QUwd86/I='
WHERE
key_id = '4c70988085c1e475535181c079e53db59de476b44e69813970a9259daf337e87'
AND (
token = 'bqdLNSo1w79mNDv5DYIpV2Bx3TIoc8IfHn3QUwd86/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)