UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ofgWColnbkUnjfvgkNwgkWD0N0+XEKVXWU8AJZijtOY='
WHERE
key_id = '5c6c379c087c8a7d28465819343dfff6cd57730ea0c70b7d3356e201985430dc'
AND (
token = 'ofgWColnbkUnjfvgkNwgkWD0N0+XEKVXWU8AJZijtOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)