UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qj8LZIiocp3M6dUmOKg66ERGFSq0DRRl8oIuVCurAPA='
WHERE
key_id = 'daae48692d9fcb03516a8bb235669b13e08e5b49670879b589aacb542ee51004'
AND (
token = 'qj8LZIiocp3M6dUmOKg66ERGFSq0DRRl8oIuVCurAPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)