UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e1sap3QFI5zFmQTGyFEAHBG3lHdKc37dSO3rZoc3lnk='
WHERE
key_id = '81de129a7047c7a799af7b0bca6daed52ec2d30791c48cf66f68af8380ccf172'
AND (
token = 'e1sap3QFI5zFmQTGyFEAHBG3lHdKc37dSO3rZoc3lnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)