UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KANx7bIiNJgaHOyxk9wGb4GGNbXxaK6/CuhWndonu+k='
WHERE
key_id = '3a60e4c43da40695e64ed7823a5484cabcb0900b797fe283d36468f3047066ca'
AND (
token = 'KANx7bIiNJgaHOyxk9wGb4GGNbXxaK6/CuhWndonu+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)