UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IEoASnUHsmYLd2xwrNzoubmo66ltqYsaPqjhoYait0o='
WHERE
key_id = '7874c223bb40fc94175c73c2c806929042c84e0a9c29e9b44f251120146bff33'
AND (
token = 'IEoASnUHsmYLd2xwrNzoubmo66ltqYsaPqjhoYait0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)